//
//  ViewController.m
//  链式编程
//
//  Created by apple on 2017/9/4.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "ViewController.h"
#import "NSObject+Calculate.h"
#import "UILabel+Convenient.h"
#import "UIButton+ConvenientBtn.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    
#pragma 链式编程 方法的返回值必须是方法调用者本身
   int s = [NSObject wt_reulst:^(CalJiSuan *cal) {
       
        cal.add(10).add(9).add(1).sub(1);
        
    }];
    
    NSLog(@"s = %d",s);
    
    
    
    
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(100, 200, 100, 50)];
   
    label.wt_text(@"烯烯").wt_font(30).wt_textColor(14, 1, 30).wt_bgColor(255, 10, 54).wt_textAlignment(@"R");
    
    
    [self.view addSubview:label];
    
    
    
    UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(100, 400, 100, 50)];
    
    btn.wt_cornerRadius(8).wt_titleAlignment(@"C").wt_titleFont(29).wt_titleColor(14, 222, 47).wt_titleLabel(@"点我");
    
    [self.view addSubview:btn];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
